package com.pzl.demo2.adapter;

import android.util.Log;

import com.pzl.demo2.interfaces.IPS2Port;
import com.pzl.demo2.interfaces.IUSBPort;

/**
 * 对象适配器
 * 将PS2接口装换成USB接口
 * 所以此类类型是USB接口(implements USBPort) + 成员变量ps2Port
 * <p/>
 * Created by zl.peng on 2016/11/2 23:22.
 */
public class PS2ToUSBAdapter implements IUSBPort {
    static final String TAG = "PS2ToUSBAdapter";

    private IPS2Port ps2Port;

    public PS2ToUSBAdapter(IPS2Port ps2Port) {
        this.ps2Port = ps2Port;
    }


    @Override
    public void workWithUSB() {
        Log.w(TAG, "转换的关键在这里,本来是");
        ps2Port.workWithPS2();
        Log.w(TAG, "经过你的转换，现在是USB工作中");
    }

}
